// page_two/dailycj/dailycj.js
let app = getApp()
let yuming = app.globalData.yuming
const request = require('../../config/request');
Page({
  ...request,
  /**
   * 页面的初始数据
   */
  data: {
    yuming: yuming,
    heights: "",
    title: '日常抽检',
    rccj: [],
    cjList:[]
  },
  backs() {
    wx.navigateBack({
      delta: 0
    })
  },
  getcjList(){
    this.myRequest(yuming + '/Administrative/adminSpotcheckList',{
        shopId: wx.getStorageSync('shopId'),
    },'POST').then((res)=>{
        console.log(res);
        this.setData({
            cjList:res.data.data
        })
    })
  },
  imgYu(e) {
    var img = e.currentTarget.dataset.src
    var list = e.currentTarget.dataset.list
    var arr = []
    for (let i in list) {
      arr.push(list[i]); //属性
    }
    wx.previewImage({
      current: img,
      urls: arr
    })
  },
  godakai(e) {
    let url = e.currentTarget.dataset.fu[0]
    wx.downloadFile({
        url: url,
        success: function (res) {
            const filePath = res.tempFilePath
            wx.openDocument({
                filePath: filePath,
                success: function (res) {
                    console.log('打开文档成功')
                }
            })

        }
    })
},
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
      this.getcjList()
    this.setData({
      heights: wx.getMenuButtonBoundingClientRect().top + 5,
      shopType: options.shopType,
      title: options.title
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },
})